/*
 *   Copyright 1999-2016 Asiainfo Technologies(China),Inc.
 *
 *   Licensed under the Apache License, Version 2.0 (the "License");
 *   you may not use this file except in compliance with the License.
 *   You may obtain a copy of the License at
 *
 *        http://www.apache.org/licenses/LICENSE-2.0
 *
 *   Unless required by applicable law or agreed to in writing, software
 *   distributed under the License is distributed on an "AS IS" BASIS,
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *   See the License for the specific language governing permissions and
 *   limitations under the License.
 *
 */

package com.asiainfo.redis.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

/**
 * @version v 1.0 on 2016/6/22 17:21
 * @auther william.xu
 */
@Entity
@Table(name="REDIS_BUSI_DATA_RULE")
@SequenceGenerator(name="REDIS_BUSI_DATA_RULE_SEQ_",sequenceName="REDIS_BUSI_DATA_RULE_SEQ",allocationSize=1)
public class BusiDataRule {
    @Id
    @GeneratedValue(strategy= GenerationType.SEQUENCE,generator="REDIS_BUSI_DATA_RULE_SEQ_")
    @Column(name = "ID")
    private Long id;

    @Column(name = "CLUSTER_ID")
    private Long clusterId;

    @Column(name = "BUSI_TYPE_ID")
    private Long busiTypeId;

    @Column(name = "KEY_PREFIX")
    private String keyPrefix;

    @Column(name = "CONFIG_NAME")
    private String configName;

    @Column(name = "DATASOURCE_ID")
    private Long datasourceId;

    @Lob
    @Column(name = "SQL")
    private String sql;

    @Column(name = "SAVE_FIELDS")
    private String saveFields;

    @Column(name = "INCRE_FIELD")
    private String increField;

    @Column(name = "MAPPING_CLASS")
    private String mappingClass;

    @Column(name = "CONDITION_TYPE")
    private Integer conditionType;

    @Column(name = "CONDITION_FIELD1")
    private String conditionField1;

    @Column(name = "CONDITION_FIELD2")
    private String conditionField2;

    @Column(name = "UNIQUE_FIELD")
    private String uniqueField;

    @Column(name = "CONDITION_FIELDS")
    private String conditionFields;

    @Column(name = "VALUE_TYPE")
    private String valueType;

    @Column(name = "LATEST_TIMESTAMP")
    private String latestTimestamp;

    @Column(name = "SCHEDULE_FLAG")
    private Integer scheduleFlag;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getClusterId() {
        return clusterId;
    }

    public void setClusterId(Long clusterId) {
        this.clusterId = clusterId;
    }

    public Long getBusiTypeId() {
        return busiTypeId;
    }

    public void setBusiTypeId(Long busiTypeId) {
        this.busiTypeId = busiTypeId;
    }

    public String getKeyPrefix() {
        return keyPrefix;
    }

    public void setKeyPrefix(String keyPrefix) {
        this.keyPrefix = keyPrefix;
    }

    public String getConfigName() {
        return configName;
    }

    public void setConfigName(String configName) {
        this.configName = configName;
    }

    public Long getDatasourceId() {
        return datasourceId;
    }

    public void setDatasourceId(Long datasourceId) {
        this.datasourceId = datasourceId;
    }

    public String getSql() {
        return sql;
    }

    public void setSql(String sql) {
        this.sql = sql;
    }

    public String getSaveFields() {
        return saveFields;
    }

    public void setSaveFields(String saveFields) {
        this.saveFields = saveFields;
    }

    public String getIncreField() {
        return increField;
    }

    public void setIncreField(String increField) {
        this.increField = increField;
    }

    public String getMappingClass() {
        return mappingClass;
    }

    public void setMappingClass(String mappingClass) {
        this.mappingClass = mappingClass;
    }

    public Integer getConditionType() {
        return conditionType;
    }

    public void setConditionType(Integer conditionType) {
        this.conditionType = conditionType;
    }

    public String getConditionField1() {
        return conditionField1;
    }

    public void setConditionField1(String conditionField1) {
        this.conditionField1 = conditionField1;
    }

    public String getConditionField2() {
        return conditionField2;
    }

    public void setConditionField2(String conditionField2) {
        this.conditionField2 = conditionField2;
    }

    public String getUniqueField() {
        return uniqueField;
    }

    public void setUniqueField(String uniqueField) {
        this.uniqueField = uniqueField;
    }

    public String getConditionFields() {
        return conditionFields;
    }

    public void setConditionFields(String conditionFields) {
        this.conditionFields = conditionFields;
    }

    public String getValueType() {
        return valueType;
    }

    public void setValueType(String valueType) {
        this.valueType = valueType;
    }

    public String getLatestTimestamp() {
        return latestTimestamp;
    }

    public void setLatestTimestamp(String latestTimestamp) {
        this.latestTimestamp = latestTimestamp;
    }

    public Integer getScheduleFlag() {
        return scheduleFlag;
    }

    public void setScheduleFlag(Integer scheduleFlag) {
        this.scheduleFlag = scheduleFlag;
    }
}
